<?php
declare(strict_types=1);
// 账号登录普通方式
namespace app\tjy_v1\controller;
class Login
{
  
    // 获取手机验证码
    public function msmCode()
    {
        cache("login@token", "111111111", 0);
        $apidb = [
            'code' => 200,
            'time' => time(),
            'msg' => "获取手机验证码",
            'token' => cache("login@token"),
            'timer' => 6,//隔时秒
            'msm_code' => mt_rand(100000, 999999), //手机验证码
        ];
        return json($apidb);
    }
    // 手机验证码登录
    public function msmLogin()
    {
        $login = [
            "token" => "4f6c22ab2d6385599f673adf3e69e7ab",
            "is_sync_info" => 1,
        ];
        $apidb = [
            'code' => 200,
            'time' => time(),
            'msg' => "手机验证码登录",
            'token' => cache("login@token"),
            'db' => $login,
        ];
        return json($apidb);
    }
    // 退出登录
    public function Exit()
    {
        cache("我是谁", null);
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "退出登录",
        ];
        return json($apidb);
    }
}
